<template> 
	<view :class="{bg:title === '登录' || title === '注册'}"> 
	<uni-nav-bar fixed :border="false" @clickLeft="clickLeft" :left-icon="icon" :title="title"  />
	</view>
</template> 
<script>
	export default { 
		props: {
			goBackFn: {
				type: Function
			},
			icon: {
				type: String,
				default: ''
			},
			title: {
				type: String,
				default: ''
			}
		},
		methods: {
		  clickLeft  ()  {
				if (this.goBackFn) {
					// 外面如果传入自定义后退函数, 就执行
					this.goBackFn()
				} else {
					uni.navigateBack()
				}
			}
		}
	}
</script>


<style lang="scss">
::v-deep.uni-navbar__header  { 
    border-bottom: 2px solid #f6f8fc !important;
	

}



  
::v-deep .bg{
	.uni-navbar__header { 
    border-bottom: 2px solid  #19cfc2 !important;
    background: #19cfc2!important;
	.uni-nav-bar-text{
	color: #ffffff !important;
	}
} }
</style>